package thread;

public class demo12 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(()->{
            for (int i = 0;i<5;i++){
                System.out.println("t working");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        });
        t.start();
        System.out.println("主进程开始阻塞");
        t.join();
        System.out.println("主进程执行结束");

    }
}
